package cn.rokhdelar.ams.business.biz.project.controller;

import cn.rokhdelar.ams.base.CustomResponse;
import cn.rokhdelar.ams.base.FlowableCommentBasePo;
import cn.rokhdelar.ams.business.biz.project.service.BizProjectInitAuditService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 项目立项审核
 * @author 范书铭
 * @date 2025年07月21日 9:03
 */
@RestController
@RequestMapping("/projectInitAuditController")
@Tag(name = "项目立项审核", description = "项目立项审核")
@RequiredArgsConstructor
public class ProjectInitAuditController {
    BizProjectInitAuditService bizProjectInitAuditService;

    /**
     * 用户提审,开启一个立项审核流程
     */
    @GetMapping("/start/{projectCode}")
    @Operation(summary = "用户提审,开启一个立项审核流程", description = "用户提审,开启一个立项审核流程")

    public CustomResponse<Boolean> start(@PathVariable(value = "projectCode") String projectCode) {
        return CustomResponse.success(bizProjectInitAuditService.startAudit(projectCode));
    }


    /**
     *  交委审核基本信息
     */
    @PostMapping("/baseInfoAudit")
    @Operation(summary = "交委审核基本信息", description = "交委审核基本信息")
    public CustomResponse<Boolean> baseInfoAudit(@RequestBody FlowableCommentBasePo commitMap) {
        return CustomResponse.success(bizProjectInitAuditService.baseInfoAudit(commitMap));
    }

    /**
     *  业主单位重新提交审核
     */
    @PostMapping("/companyReTry")
    @Operation(summary = "交委审核基本信息", description = "交委审核基本信息")
    public CustomResponse<Boolean> companyReTry(@RequestBody FlowableCommentBasePo commitMap) {
        return CustomResponse.success(bizProjectInitAuditService.companyReTry(commitMap));
    }

    /**
     *  交委选择审批方式(标准/简易)
     */
    @PostMapping("/selectAuditType")
    @Operation(summary = "交委选择审批方式(标准/简易)", description = "交委选择审批方式(标准/简易)")
    public CustomResponse<Boolean> selectAuditType(@RequestBody FlowableCommentBasePo flowableCommentBasePo) {
        return CustomResponse.success(bizProjectInitAuditService.selectAuditType(flowableCommentBasePo));
    }
}
